home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Education
/
World of Education.iso
/
world_p
/
pcshx10b.zip
/
PCSHX10B.EXE
/
GNUFGREP.EXE
/
GREPDOCS.EXE
/
MSDOSMAC.H
< prev
next >
Wrap
Text File
|
1990-08-06
|
616b
|
28 lines
/*
* The macro EXTRACT_PROGRAM_NAME(p) converts an MSDOS style argument 0
* full path program name to a nice, Un*x style argument 0 program name.
*/
#define EXTRACT_PROGRAM_NAME(p) \
{ \
char *q, *strchr(), *strrchr(); \
if (q = strrchr(p, '\\')) \
p = q + 1; \
if (q = strchr(p, '.')) \
*q = '\0'; \
strlwr(p); \
}
/*
* The macro CONVERT_TO_SLASHES(p) converts all backslashes in a pathname
* to forward slashes.
*/
#define CONVERT_TO_SLASHES(p) \
{ \
char *q; \
for (q = p; *q; ++q) \
if (*q == '\\') \
*q = '/'; \
}